package com.zju.DoctorGo.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zju.DoctorGo.dto.MessageFilterDTO;
import com.zju.DoctorGo.entity.Message;
import com.zju.DoctorGo.mapper.MessageMapper;
import com.zju.DoctorGo.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MessageServiceImpl extends ServiceImpl<MessageMapper, Message> implements MessageService{

    @Autowired
    private MessageMapper messageMapper;

    @Override
    public List<Message> getMessages(MessageFilterDTO filter) {
        return messageMapper.selectByFilter(filter);
    }

    @Override
    public void addMessage(Message message) {
        messageMapper.insert(message);
    }

    @Override
    public void deleteMessages(List<Long> messageIds) {
        messageMapper.deleteBatchIds(messageIds);
    }
}
